<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>lesson 12</title>
</head>

<body>
    <div id="root"></div>
</body>

</html>
<script src="https://unpkg.com/vue@next"></script>
<script>
    // input textarea  checkbox  radio select
    // 修饰符  lazy失去焦点时同步数据
    //         number把内容装换成number类型
    //         trim去除输入内容前后的空格   不去除内容中间的空格
    const app = Vue.createApp({
        data() {
            return {
                message: 'hello',
                flag: false,
                arr: [],
                obj: "",
                message1: '',
                message2: [],
                message3: [],
                // options: [
                //     { text: 'A', value: 'A' },
                //     { text: 'B', value: 'B' },
                //     { text: 'C', value: 'C' },
                // ],
                options: [
                    { text: 'A', value: {value: 'A'} },
                    { text: 'B', value: {value: 'B'} },
                    { text: 'C', value: {value: 'C'} },
                ],
            }
        },
        methods: {

        },
        template: `
        <div>
            {{message}}
            <input v-model="message" />
            <textarea v-model="message"></textarea>
            <br />
            {{arr}}
            <input type="checkbox" v-model="arr" value="jack" />jack 
            <input type="checkbox" v-model="arr" value="dell" />dell 
            <input type="checkbox" v-model="arr" value="lee" />lee 
            <br />
            {{obj}}
            <input type="radio" v-model="obj" value="jack" />jack 
            <input type="radio" v-model="obj" value="dell" />dell 
            <input type="radio" v-model="obj" value="lee" />lee 
            <br />
            {{message1}}
            <select v-model="message1">
                <option disabled value="">请选择内容</option>
                <option value="A">A</option>
                <option value="B">B</option>
                <option value="C">C</option>
            </select>
            <br />
            {{message2}}
            <select v-model="message2" multiple>
                <option value="A">A</option>
                <option value="B">B</option>
                <option value="C">C</option>
            </select>
            <br />
            {{message3}}
            <select v-model="message3" multiple>
                <option v-for="item in options" :value="item.value">{{item.text}}</option>
            </select>
        </div>
        `
    });
    const vm = app.mount('#root')
</script>